<?php
class DispatchSignatures extends CActiveRecord{
	public static function model($className = __CLASS__){
		return parent::model($className);
	}	

	public function tableName(){
		return 'tbl_dispatch_signatures';
	}

	public function rules(){
		return array(
			array('dispatch,filename,empno','required'),
			array('datepostedfromiphone,name_entered','safe')
		);
	}

	public function relations(){
		return array(
		);
	}

	public function attributeLabels(){
		return array(

		);
	}

	public function beforeValidate(){
		if(Yii::app()->user->isGuest == false){
			if($this->empno == null || trim($this->empno)==''){
				$this->empno = Yii::app()->user->model->employeeid;	
			}
			
		}
		return parent::beforeValidate();
	}
}